package com.jsmtr.rms.service;

import com.jsmtr.rms.entity.Knowledge;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author wyh
 */
public interface IKnowledgeManageService {

    Map<String, Object> getKnowledgePointList(int page, int limit, Map<String, Object> search) throws Exception;

    /**
     * 插入一条Knowledge
     * @param knowledge 插入值
     * @param knowledgeName 知识点名称
     * @param position 所属岗位
     * @param request HttpServletRequest
     * @return 成功?
     */
    boolean addKnowledge(List<Knowledge> knowledge, String knowledgeName, String position, HttpServletRequest request);

    /**
     * 编辑一条Knowledge
     * @param knowledge 编辑值
     * @return 成功?
     */
    boolean editKnowledge(List<Knowledge> knowledge, String knowledgeName, String position);

    /**
     * 使能/禁止一条Knowledge
     * @param knowledgeId id
     * @param knowledgeState 使能/禁止
     * @param request HttpServletRequest
     * @return 成功?
     */
    boolean enableKnowledge(String knowledgeId, String knowledgeState, HttpServletRequest request);


    boolean deleteKnowledge(String id);

    /**
     * 获得KnowManage列表
     * @param page 第几页
     * @param limit 每页多少条
     * @param position 过滤所属岗位
     * @param knowledgeState 过滤状态
     * @param keyWord 过滤关键词
     * @param orderKey 排序键
     * @param orderType 排序方式(asc?desc)
     * @return 分页KnowManage
     * @throws Exception 抛出异常
     */
    Map<String, Object> getKnowledgeList(int page, int limit, String position, String knowledgeState, String keyWord
            , String orderKey, String orderType) throws Exception;

    List getJobs() throws Exception;
}
